home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ASME's Mechanical Engine…ing Toolkit 1997 December
/
ASME's Mechanical Engineering Toolkit 1997 December.iso
/
c_lang
/
mssup201.z00
/
msc.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-08-24
|
2KB
|
74 lines
/* @(#) msc.c */
int _stklen = 30000; /* stack size in bytes */
_setenvp() {} /* don't initialize environment pointer etc. */
#include <fcntl.h>
unsigned _fmode = O_BINARY;
#ifdef LINT_ARGS
void dosname (char *, char *);
char *strcpy (char *, char *);
#else
void dosname ();
char *strcpy ();
#endif
/****************
function trunc() truncates a file -- ok to be a no-op
*/
int trunc (handle)
int handle;
{
/* avoid compiler warning about unused argument */
return (handle - handle);
}
/****************
Function fixfname() converts the supplied filename to a syntax
legal for the host system. It is used during extraction.
*/
char *fixfname(fname)
char *fname;
{
char tmpname[PATHSIZE];
dosname (nameptr(fname), tmpname);
strcpy(fname,tmpname);
return(fname);
}
#include <signal.h>
#include "intdos.h"
static int set_break (flag)
int flag;
{
int retval;
union REGS regs;
regs.x.ax = 0x3300; /* get ctrl-break flag */
intdos (®s, ®s);
retval = regs.h.dl; /* retval is old value of setting */
regs.x.ax = 0x3301; /* set ctrl-break flag */
regs.h.dl = flag; /* status to set to */
intdos (®s, ®s);
return (retval);
}
static int break_flag;
int zooexit (status)
int status;
{
set_break (break_flag); /* restore control_break setting */
exit (status);
}
void gentab (void);
void spec_init()
{
break_flag = set_break (0);
signal (SIGINT, zooexit); /* install our own control-C handler */
}